#include "mcstatus.h"

namespace MCCommon
{

MCStatus::MCStatus()
:   fErrType( kET_OK ),
    fErrCode( 0 )
{    
}

MCStatus::MCStatus
( 
    long errcode, 
    bool isWarning /* = false */ 
)
:    fErrCode( errcode )
{
    if ( isWarning )
    {
        fErrType = KET_Warning;
    }
    else 
    {
        fErrType = kET_Error;
    }   
}

MCStatus::~MCStatus()
{
}

bool 
MCStatus::IsOK() const
{
    return ( fErrType == kET_OK );
}

bool 
MCStatus::IsError() const
{
    return ( fErrType == kET_Error );
}

bool 
MCStatus::IsWarning() const
{
    return ( fErrType == KET_Warning );
}

long 
MCStatus::GetErrorCode() const
{
    return fErrCode;
}

} // end of namespace MCCommon
